KGR's Amazing DB Summary not the real page name Real Page Name 6b 65 65 70 20 6f 7 Some Simple Rules:
First Normal Form - (1NF) A proper database can not have repeating information in a column or the same information in a row.
Second Normal Form - (2NF) The columns should be dependent on the Primary key. If the primary key consists of multiple pieces of details, the attributes (columns) should be dependent on the entire primary key.
Third Normal Form - (3NF) The primary key should be the only factor affecting the other values in the table.
Tables in the database must have a one-to-one or a one-to-many relationship. There cannot be any many-to-many relationships.
Primary keys always has to have a value while non-primary keys do not.
Example of First Normal Form
Bold = Primary Key Red Outline = The Problem (The "Type" column has repeating data; thus, in violation of the First Normal form rule)
Music Collection Example
Problem: The "Label" column contains similar data in one cell which is in violation of the First Normal Form.
Example of Second Normal Form
Bold = Primary Key Red Outline = The Problem This time the "Time Zone" attribute is in violation of the Second Normal Form since the it does not depend on the entire primary keys (Longitude/Latitude); it depends on the Longitude.
Example of Third Normal Form
Bold = Primary Key Red Outline = The ProblemThe "Location" attribute is not dependent on the Primary key (Game ID), instead it's related to the Company column.
Entity Relationship Diagrams
http://www.smartdraw.com/resources/tutorials/entity-relationship-diagrams/ Entity Relationship Diagrams are usually used to plan out database layouts. Here is a video that talks more about ER diagrams and how to make them. The picture above is an example of the basic layout of an Entity Relationship Diagram. Each entity is like a table and the attributes are the information in the tables. Each entity is linked to another one through similarities between their primary keys.
Proper Database Design
Table of Contents
Some Simple Rules:
First Normal Form - (1NF) A proper database can not have repeating information in a column or the same information in a row.
Second Normal Form - (2NF) The columns should be dependent on the Primary key. If the primary key consists of multiple pieces of details, the attributes (columns) should be dependent on the entire primary key.
Third Normal Form - (3NF) The primary key should be the only factor affecting the other values in the table.
Tables in the database must have a one-to-one or a one-to-many relationship. There cannot be any many-to-many relationships.
Primary keys always has to have a value while non-primary keys do not.
Example of First Normal Form
Bold = Primary Key
Red Outline = The Problem (The "Type" column has repeating data; thus, in violation of the First Normal form rule)
Music Collection Example
Example of Second Normal Form
Bold = Primary Key
Red Outline = The Problem This time the "Time Zone" attribute is in violation of the Second Normal Form since the it does not depend on the entire primary keys (Longitude/Latitude); it depends on the Longitude.
Example of Third Normal Form
Bold = Primary Key
Red Outline = The ProblemThe "Location" attribute is not dependent on the Primary key (Game ID), instead it's related to the Company column.
Entity Relationship Diagrams
http://www.smartdraw.com/resources/tutorials/entity-relationship-diagrams/ Entity Relationship Diagrams are usually used to plan out database layouts. Here is a video that talks more about ER diagrams and how to make them. The picture above is an example of the basic layout of an Entity Relationship Diagram. Each entity is like a table and the attributes are the information in the tables. Each entity is linked to another one through similarities between their primary keys.